package com.eastfair.certificate.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.annotation.annotation.dictionary.DictionaryField;
import com.eastfair.auth.vo.UserAccountVo;
import com.eastfair.certificate.entity.CertificateUser;
import com.eastfair.certificate.enumeration.*;
import com.eastfair.demand.certificate.CertificateOrderGroup;
import com.eastfair.demand.certificate.CertificateUserGroup;
import com.eastfair.venuebooking.vo.ExhibitionSpaceVO;
import com.eastfair.venueservice.vo.ExhibitionManageVO;
import com.eastfair.venueservice.vo.ServiceProviderVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import lombok.Data;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.eastfair.annotation.annotation.vo.VoInfo;
import com.eastfair.annotation.model.BaseVoGroupClass;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import com.eastfair.vo.BaseVO;
import org.springframework.format.annotation.DateTimeFormat;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 制证订单
 * </p>
 *
 * @author ligang
 * @since 2022-08-02
 */
@Data
@ApiModel(value = "CertificateOrderVO", description = "制证订单")
public class CertificateOrderVO extends BaseVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Long id;

    /**
     * 订单码
     */
    @ApiModelProperty(value = "订单码")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Size(max = 255, message = "订单码长度不能超过255")
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String orderNumber;
    /**
     * authReturnOrder
     * 证件费
     */
    @ApiModelProperty(value = "证件费")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private BigDecimal costMoney;
    /**
     * 超时费
     */
    @ApiModelProperty(value = "超时费")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private BigDecimal overTimeMoney;
    /**
     * 押金
     */
    @ApiModelProperty(value = "押金")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private BigDecimal depositMoney;
    /**
     * 退款金
     */
    @ApiModelProperty(value = "退款金")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CertificateOrderGroup.all.class})
    private BigDecimal returnMoney;
    /**
     * 退款方式:#{ONLINE:线上退款;OFFLINE:线下;}
     */
    @ApiModelProperty(value = "退款方式:#{ONLINE:线上退款;OFFLINE:线下;}")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CertificateOrderGroup.all.class})
    private CertificateOrderReturnTypeEnum returnType;
    /**
     * 凭证号
     */
    @ApiModelProperty(value = "凭证号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Size(max = 256, message = "凭证号长度不能超过256")
    private String voucherNumber;
    /**
     * 退款理由
     */
    @ApiModelProperty(value = "退款理由")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Size(max = 256, message = "退款理由长度不能超过256")
    private String returnLabel;
    /**
     * 公司id
     */
    @ApiModelProperty(value = "公司id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Long companyId;
    /**
     * 是否领取
     */
    @ApiModelProperty(value = "是否领取")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Integer isDraw;
    /**
     * 是否开取发票
     */
    @ApiModelProperty(value = "是否开取发票")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Integer isTake;
    /**
     * 是否支付
     */
    @ApiModelProperty(value = "是否支付")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Integer isPay;
    /**
     * 是否打印小票
     */
    @ApiModelProperty(value = "是否打印小票")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Integer isPrintTake;
    /**
     * 是否取消
     */
    @ApiModelProperty(value = "是否取消")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Integer isCancel;
    /**
     * 是否退款
     */
    @ApiModelProperty(value = "是否退款")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Integer isReturn;
    /**
     * 是否可用，1是；0否
     */
    @ApiModelProperty(value = "是否可用，1是；0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer isEnabled;
    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer isDeleted;
    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long tenantId;
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long projectId;
    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long subsystemId;

    /**
     * 退款状态:#{AUTH:审核中;AUTH_SUCESS:审核成功;AUTH_FAIL:审核失败;}
     */
    @ApiModelProperty(value = "退款状态:#{AUTH:审核中;AUTH_SUCESS:审核成功;AUTH_FAIL:审核失败;}")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CertificateOrderGroup.all.class})
    private CertificateOrderAuthReturnStatusEnum authReturnStatus;
    /**
     * 展会ID
     */
    @ApiModelProperty(value = "展会ID")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Long exhibitionId;
    /**
     * 证件类型:#{CAR:车证;PEOPLE:人证;POWER:机力车证;OTHER:其他证;}
     */
    @ApiModelProperty(value = "证件类型:#{CAR:车证;PEOPLE:人证;POWER:机力车证;OTHER:其他证;}")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private CertificateOrderCertificateTypeEnum certificateType;

    @ApiModelProperty("创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @VoInfo(groups = {CertificateOrderGroup.all.class})
    protected LocalDateTime createTime;

    @ApiModelProperty("创建人ID")
    @VoInfo(groups = {CertificateOrderGroup.all.class})
    protected Long createdBy;


    /**
     * 领取人姓名
     */
    @ApiModelProperty(value = "领取人姓名")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String drawName;

    /**
     * 领取人手机号
     */
    @ApiModelProperty(value = "领取人手机号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String drawMobile;

    /**
     * 领取人身份证号
     */
    @ApiModelProperty(value = "领取人身份证号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String drawIdcard;


    @ApiModelProperty("创建人")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CertificateOrderGroup.all.class})
    protected UserAccountVo createUser;
    /**
     * 服务商信息
     */
    @ApiModelProperty(value = "服务商信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CertificateOrderGroup.pageOrder.class})
    private ServiceProviderVO serviceProviderVO;

    /**
     * 展会预定场地
     */
    @ApiModelProperty(value = "展会预定场地")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CertificateOrderGroup.pageOrder.class})
    private ExhibitionSpaceVO exhibitionSpaceVO;

    /**
     * 展会信息
     */
    @ApiModelProperty(value = "展会信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CertificateOrderGroup.pageOrder.class})
    private ExhibitionManageVO exhibitionManageVO;

    /**
     * 退单状态:#{REFUND:退款中;NO_REFUND:未退款;YES_REFUND:已退款;}
     */
    @ApiModelProperty(value = "退单状态:#{REFUND:退款中;NO_REFUND:未退款;YES_REFUND:已退款;}")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private CertificateOrderReturnOrderStatusEnum returnOrderStatus;

    /**
     * 试卷信息
     */
    @ApiModelProperty(value = "试卷信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CertificateOrderGroup.pageOrder.class})
    private List<CertificateUserVO> certificateUserVOList;


    /**
     * 领取方式:#{MAKE:预约领取;SITE现场领取;}
     */
    @ApiModelProperty(value = "领取方式:#{MAKE:预约领取;SITE现场领取;}")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private CertificateOrderDrawTypeEnum drawType;

    /**
     * 领取时间
     */
    @ApiModelProperty(value = "领取时间")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private LocalDateTime drawTime;

    /**
     * 领取预约时间
     */
    @ApiModelProperty(value = "领取预约时间")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private LocalDateTime drawMakeTime;


    @ApiModelProperty("更新时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @VoInfo(groups = {CertificateOrderGroup.all.class})
    protected LocalDateTime updateTime;
    /**
     * 制证数量
     */
    @ApiModelProperty(value = "制证数量")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Integer certificateNum;

    /**
     * 开票状态 数据字典
     */
    @ApiModelProperty(value = "开票状态 数据字典")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Size(max = 50, message = "开票状态 数据字典长度不能超过50")
    @DictionaryField(type = "SETTLEMENT_INVOICING_STATUS")
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String invoiceState;


    /**
     * 退单状态:支付系统
     */
    @ApiModelProperty(value = "退单状态:支付系统")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    @DictionaryField(type = "SETTLEMENT_REFUND_STATUS")
    private String returnOrderStatusOfPay;

    /**
     *  主体类型  主运，搭建商，参展商
     */
    @ApiModelProperty(value = " 主体类型  主运，搭建商，参展商")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    @DictionaryField(type = "SERVICE_PROVIDER_TYPE")
    private String principalType;

    /**
     * 展馆code
     */
    @ApiModelProperty(value = "展馆code")
    @Size(max = 255, message = "展馆code长度不能超过255")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String spaceCode;


    /**
     * 实际领取单号
     */
    @ApiModelProperty(value = "实际领取单号")
    @Size(max = 255, message = "实际领取单号长度不能超过255")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String drawNumberEnd;

    /**
     * 实际领取人手机号
     */
    @ApiModelProperty(value = "实际领取人手机号")
    @Size(max = 255, message = "实际领取人手机号长度不能超过255")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String drawMobileEnd;

    /**
     * 实际领取人身份证号
     */
    @ApiModelProperty(value = "实际领取人身份证号")
    @Size(max = 255, message = "实际领取人身份证号长度不能超过255")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String drawIdcardEnd;

    /**
     * 实际领取人姓名
     */
    @ApiModelProperty(value = "实际领取人姓名")
    @Size(max = 255, message = "实际领取人姓名长度不能超过255")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String drawNameEnd;



    /**
     * 实际支付金额
     */
    @ApiModelProperty(value = "实际支付金额")
    private BigDecimal orderMoney;
    /**
     * 订单状态:#{NO_PAY:未支付;WAIT:支付中;PAY_FAIL:支付失败;PAY_SUCC:支付成功;}
     */
    @ApiModelProperty(value = "订单状态:#{NO_PAY:未支付;WAIT:支付中;PAY_FAIL:支付失败;PAY_SUCC:支付成功;}")
    private CertificateOrderOrderStatusEnum orderStatus;


}
